//
//  PayQueryDetailController.m
//  PropertyMananger
//
//  Created by Mansion on 17/2/26.
//  Copyright © 2017年 BH. All rights reserved.
//

#import "PayQueryDetailController.h"
#import "CheckFormDetailCell.h"

@interface PayQueryDetailController ()

@end

@implementation PayQueryDetailController

- (void)viewDidLoad {
    [super viewDidLoad];

    [self initTitleViewName:@"物业缴费查询详情"];
    
    [self initTableViewWithView:self.view frame:CGRectMake(0, 0, BHscreenW, BHscreenH -64) isGroup:NO];
    
    self.tableView.backgroundColor = BHGrayColor;

}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
        return 9;
    
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    CheckFormDetailCell * cell = [CheckFormDetailCell cellWithTableView:tableView];
    
        if (indexPath.row == 0) {
            
            self.titleStr = @"缴费类型:";
            self.pingjieStr = [NSString stringWithFormat:@"%@  %@",self.titleStr,@"物业费"];
            
            self.stra = [[NSMutableAttributedString alloc]initWithString:self.pingjieStr];//可随意拼接字符串
            [self.stra addAttributes:@{NSFontAttributeName:BHFont(15),NSForegroundColorAttributeName:BHColor(102, 102, 102)} range:NSMakeRange(0, self.titleStr.length)];
            cell.infoLabel.attributedText = self.stra;
            
        }else if (indexPath.row == 1){
            
            self.titleStr = @"楼栋:";
            self.pingjieStr = [NSString stringWithFormat:@"%@ %@%@",self.titleStr,self.model.BuildName,self.model.UnitName];
            
            self.stra = [[NSMutableAttributedString alloc]initWithString:self.pingjieStr];//可随意拼接字符串
            [self.stra addAttributes:@{NSFontAttributeName:BHFont(15),NSForegroundColorAttributeName:BHColor(102, 102, 102)} range:NSMakeRange(0, self.titleStr.length)];
            cell.infoLabel.attributedText = self.stra;
            
        }else if (indexPath.row == 2){
            self.titleStr = @"房间号:";
            self.pingjieStr = [NSString stringWithFormat:@"%@  %@",self.titleStr,self.model.RoomName];
            
            self.stra = [[NSMutableAttributedString alloc]initWithString:self.pingjieStr];//可随意拼接字符串
            [self.stra addAttributes:@{NSFontAttributeName:BHFont(15),NSForegroundColorAttributeName:BHColor(102, 102, 102)} range:NSMakeRange(0, self.titleStr.length)];
            cell.infoLabel.attributedText = self.stra;
            
        }else if (indexPath.row == 3){
            
            self.titleStr = @"业主姓名:";
            self.pingjieStr = [NSString stringWithFormat:@"%@  %@",self.titleStr,self.model.OwnerName];
            
            self.stra = [[NSMutableAttributedString alloc]initWithString:self.pingjieStr];//可随意拼接字符串
            [self.stra addAttributes:@{NSFontAttributeName:BHFont(15),NSForegroundColorAttributeName:BHColor(102, 102, 102)} range:NSMakeRange(0, self.titleStr.length)];
            cell.infoLabel.attributedText = self.stra;
            
        }else if (indexPath.row == 4){
            
            self.titleStr = @"缴费月份:";
            self.pingjieStr = [NSString stringWithFormat:@"%@  %@",self.titleStr,self.model.GenerateDate];
            
            self.stra = [[NSMutableAttributedString alloc]initWithString:self.pingjieStr];//可随意拼接字符串
            [self.stra addAttributes:@{NSFontAttributeName:BHFont(15),NSForegroundColorAttributeName:BHColor(102, 102, 102)} range:NSMakeRange(0, self.titleStr.length)];
            cell.infoLabel.attributedText = self.stra;
        }else if (indexPath.row == 5){
            
            self.titleStr = @"缴费日期:";
            if (self.model.ChargingDate == nil) {
                
              self.pingjieStr = [NSString stringWithFormat:@"%@  %@",self.titleStr,@""];
            }else{
             self.pingjieStr = [NSString stringWithFormat:@"%@  %@",self.titleStr,self.model.ChargingDate];
            }
            
            self.stra = [[NSMutableAttributedString alloc]initWithString:self.pingjieStr];//可随意拼接字符串
            [self.stra addAttributes:@{NSFontAttributeName:BHFont(15),NSForegroundColorAttributeName:BHColor(102, 102, 102)} range:NSMakeRange(0, self.titleStr.length)];
            cell.infoLabel.attributedText = self.stra;
        }else if (indexPath.row == 6){
            
            self.titleStr = @"缴费状态:";
            self.pingjieStr = [NSString stringWithFormat:@"%@  %@",self.titleStr,self.model.ChargeState];
            
            self.stra = [[NSMutableAttributedString alloc]initWithString:self.pingjieStr];//可随意拼接字符串
            [self.stra addAttributes:@{NSFontAttributeName:BHFont(15),NSForegroundColorAttributeName:BHColor(102, 102, 102)} range:NSMakeRange(0, self.titleStr.length)];
             cell.infoLabel.textColor = [UIColor redColor];
            cell.infoLabel.attributedText = self.stra;
            
        }else if (indexPath.row == 7){
            
            self.titleStr = @"缴费金额:";
            self.pingjieStr = [NSString stringWithFormat:@"%@  %@",self.titleStr,self.model.Cost];
            
            self.stra = [[NSMutableAttributedString alloc]initWithString:self.pingjieStr];//可随意拼接字符串
            [self.stra addAttributes:@{NSFontAttributeName:BHFont(15),NSForegroundColorAttributeName:BHColor(102, 102, 102)} range:NSMakeRange(0, self.titleStr.length)];
            cell.infoLabel.textColor = [UIColor redColor];
            cell.infoLabel.attributedText = self.stra;
        }else if (indexPath.row == 8){
            
            self.titleStr = @"缴费方式:";
            if (self.model.ChargingWay == nil) {
                
              self.pingjieStr = [NSString stringWithFormat:@"%@  %@",self.titleStr,@""];
            }else{
                
            self.pingjieStr = [NSString stringWithFormat:@"%@  %@",self.titleStr,self.model.ChargingWay];
            }
            
            
            self.stra = [[NSMutableAttributedString alloc]initWithString:self.pingjieStr];//可随意拼接字符串
            [self.stra addAttributes:@{NSFontAttributeName:BHFont(15),NSForegroundColorAttributeName:BHColor(102, 102, 102)} range:NSMakeRange(0, self.titleStr.length)];
            cell.infoLabel.attributedText = self.stra;
        }
        
       return cell;
    
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 50;
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];

}

@end
